<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
$type = $_GET["type"];
$path = $_GET["path"];
require_once("ExcelReader.php");
$obj = new ExcelReader($path);
$content = $obj->read();
$import = new ExcelImport($content);
if($type=="student")
{
	$pos = array(1,3,4,6);
	$import->import("SINHVIEN",$pos);
}
else if($type=="teacher")
{
	$pos = array(0,1,3,4,5);
	$import->import("GIAOVIEN",$pos);
}
else if($type=="subject")
{
	$pos = array(0,1,4);
	$import->import("MONHOC",$pos);
}
else if($type=="class")
{
	$pos = array(0,1,2,3,5,7);
	$import->import("LOP",$pos);
}
else if($type=="department")
{ 
	$pos = array(0,1);
	$import->import("KHOA",$pos);
}
else if($type=="register")
{
	$pos = array(0,1,2,4);
	$import->import("DANGKY",$pos);
}
else if($type=="admin")
{
	$pos = array(0,1,4,3);
	$import->import("QUANTRIVIEN",$pos);
}
else if($type=="result")
{
	$pos = array(1,3);
	$import->importResult("KETQUA",$pos);
}
else if($type=="mark")
{
	$import->importMark($_GET["subjectID"],$_GET["semeterID"],$_GET["yearID"]);
}
?>
</body>
</html>